﻿using System;

using NUnit.Framework;
using Spring.Testing.NUnit;

using VisualAgile.Model;
using VisualAgile.IDAL;

namespace VisualAgile.DAL.Tests
{
    [TestFixture]
    public class StoryDaoTest : AbstractTransactionalDbProviderSpringContextTests
    {
        protected override string[] ConfigLocations
        {
            get
            {
                return new String[] { "objects.xml" };
            }
        }

        protected IStoryDao StoryDao
        {
            get
            {
                return applicationContext.GetObject("StoryDao") as IStoryDao;
            }
        }

        [Test]
        public void SaveStoryTest()
        {
            Story story = new Story();

            story.CreateTime = DateTime.Now;
            story.Name = "New Story";
            story.Size = 1.0F;
            story.Primary = true;

            StoryDao.Save(story);
            transactionManager.Commit(transactionStatus);
        }       
    }
}
